Skip to content

feat(runtime): 抽出 action-execution 子系统 — ADR-0076 D11 步骤③ PR-8 (#2462) - #3565

Merged
os-zhuang merged 1 commit into
mainfrom
feat/d11-step3-action-execution-module
Jul 27, 2026
Merged

feat(runtime): 抽出 action-execution 子系统 — ADR-0076 D11 步骤③ PR-8 (#2462)#3565
os-zhuang merged 1 commit into
mainfrom
feat/d11-step3-action-execution-module

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

动机(#2462 D11 步骤③,深耦合批第一刀)

/actions/mcp(经 buildMcpBridge)共享 16 个 dispatcher 私有 helper(~560 行):action 声明收集/解析、ADR-0104 参数强制、权限/AI 暴露门、engine facade + session 形状、调用执行、callData 协议/ObjectQL 数据桥。本刀把它们抽成 action-execution.ts 独立模块——这是让 PR-9 的两域抽体变回机械刀的前置。

设计

  • ActionExecutionDeps 刻意窄:只有 resolveService + getObjectQL——env 解析状态(kernel/resolver)一概不进,留在路由 handler 层。调查证实 16 个体内零 kernel 依赖。
  • ADR-0104 warn-once 静态成员(actionParamsStrict/warnActionParamsOnce)随体搬为模块函数——抽出的体引用 HttpDispatcher. 静态会形成回环。
  • dispatcher 保留 4 个有类内调用点的薄委托;12 个纯内部 helper 的 5 处调用点(buildMcpBridge/handleActions 内)改直调模块。

验证

runtime 649 绿;http-conformance 41 绿;dogfood 全套 351 绿(须先全仓 build——套件依赖全部 example/connector dist);下游闭包 DTS 绿。零行为变化。

关联 #2462。下一刀 PR-9:/actions + /mcp 两域抽体。

🤖 Generated with Claude Code

… ③ PR-8 (#2462)

16 helpers (~560 lines) behind server-registered business actions move
to action-execution.ts on the narrow ActionExecutionDeps slice
(resolveService + getObjectQL — deliberately NO env-resolution state;
that stays with route handlers). The ADR-0104 warn-once statics
(actionParamsStrict/warnActionParamsOnce) ride along as module
functions — they were HttpDispatcher statics the extracted body
referenced, which would have made a value-cycle back into the
dispatcher.

Dispatcher keeps 4 thin delegates that have in-class callers
(callData/enforceActionParams/actionPermissionError/buildActionSession);
the 12 internal-only helpers are invoked directly on the module (5 call
sites in buildMcpBridge/handleActions rewired).

This is the pre-cut for PR-9: /actions and /mcp become mechanical
domain extractions now that their shared machinery is a module.

Verified: runtime 649, http-conformance 41, dogfood 351 (full-build
first — the suite needs every example/connector dist), dependent
closure DTS green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Jul 27, 2026 6:07am

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation tooling size/xl labels Jul 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/runtime.

17 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/api/index.mdx (via @objectstack/runtime)
  • content/docs/api/wire-format.mdx (via @objectstack/runtime)
  • content/docs/automation/hook-bodies.mdx (via @objectstack/runtime)
  • content/docs/concepts/north-star.mdx (via packages/runtime)
  • content/docs/data-modeling/drivers.mdx (via @objectstack/runtime)
  • content/docs/deployment/index.mdx (via @objectstack/runtime)
  • content/docs/deployment/production-readiness.mdx (via @objectstack/runtime)
  • content/docs/deployment/single-project-mode.mdx (via @objectstack/runtime)
  • content/docs/deployment/vercel.mdx (via @objectstack/runtime)
  • content/docs/getting-started/your-first-project.mdx (via @objectstack/runtime)
  • content/docs/permissions/authentication.mdx (via @objectstack/runtime)
  • content/docs/permissions/authorization.mdx (via packages/runtime)
  • content/docs/plugins/packages.mdx (via @objectstack/runtime)
  • content/docs/protocol/kernel/http-protocol.mdx (via @objectstack/runtime)
  • content/docs/protocol/kernel/index.mdx (via @objectstack/runtime)
  • content/docs/protocol/kernel/lifecycle.mdx (via @objectstack/runtime)
  • content/docs/releases/implementation-status.mdx (via @objectstack/runtime)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

@os-zhuang
os-zhuang merged commit 3216344 into main Jul 27, 2026
16 checks passed
@os-zhuang
os-zhuang deleted the feat/d11-step3-action-execution-module branch July 27, 2026 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/xl tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant